<template>
  <div class="offline-products-log">
    <BasicModal
      @register="register"
      :title="title"
      width="800px"
      :destroyOnClose="true"
      :canFullscreen="false"
      :showOkBtn="false"
      :showCancelBtn="true"
    >
      <BasicTable @register="registerTable"> </BasicTable>
    </BasicModal>
  </div>
</template>

<script lang="ts" setup>
  import { getUnmounRecordList } from '@/api/hby/productManage';
  import { BasicModal, useModalInner } from '@/components/Modal';
  import { useTable, BasicTable } from '@/components/Table';
  import { ref } from 'vue';
  const title = ref('下架产品');
  const id = ref(0);
  const emit = defineEmits(['reload', 'register']);
  const [registerTable] = useTable({
    api: (params: any) => {
      return getUnmounRecordList(params, id.value);
    },
    maxHeight: 480,
    columns: [
      {
        title: '操作管理员',
        dataIndex: 'operateUserName',
        width: 100,
      },
      {
        title: '下架时间',
        dataIndex: 'createTime',
        width: 200,
      },
      {
        title: '下架原因',
        dataIndex: 'unmounTypeName',
        width: 100,
      },
      {
        title: '补充说明',
        dataIndex: 'explain',
        width: 200,
      },
    ],
    showIndexColumn: true,
    clickToRowSelect: false,
    useSearchForm: false,
    showTableSetting: true,
    tableSetting: {
      redo: false,
      size: false,
      setting: false,
      fullScreen: false,
    },
  });
  const [register] = useModalInner((data: { id: number }) => {
    id.value = data.id;
  });
</script>

<style lang="less" scoped>
  ::v-deep .ant-table-title {
    min-height: 0 !important;
    padding: 0 !important;
  }
</style>
